package com.cyy.common.pojo.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
@Schema(name = "CommentTree", description = "评论")
public class CommentTreeDto {

    @Schema(description = "id")
    private Integer id;

    @Schema(description = "父id")
    private Integer parentId;

    @Schema(description = "头像地址")
    private String avatar;

    @Schema(description = "用户名")
    private String username;

    @Schema(description = "回复人用户名")
    private String replyUsername;

    @Schema(description = "文章id(0 代表留言)")
    @JsonIgnore
    private Integer articleId;

    @Schema(description = "用户id")
    private Integer userId;

    @Schema(description = "评论内容")
    private String content;

    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "IP地址")
    private String ipAddress;

    @Schema(description = "浏览器")
    private String browser;

    @Schema(description = "浏览器版本")
    private String browserVersion;

    @Schema(description = "系统")
    private String system;

    @Schema(description = "系统版本")
    private String systemVersion;

    // 只用作处理，不做序列化
    @Schema(description = "评论类型 0:评论,1:点赞,2:踩")
    @JsonIgnore
    private Integer type;

    @Schema(description = "点赞数")
    private Integer likeCount = 0;

    @Schema(description = "是否点赞")
    private Boolean clickLike = false;

    @Schema(description = "踩数")
    private Integer dislikeCount = 0;

    @Schema(description = "是否点踩")
    private Boolean clickDislike;

    @Schema(description = "其他评论")
    private List<CommentTreeDto> children;
}
